const Router = require('koa-router')

const router = new Router()

// router.prefix('/dev-api')

router.post('/user/login',async (ctx)=>{

    console.log("123")

    let list = Object.keys(ctx.request.body)
    
    ctx.body = {
        code:1,
        data:{
            token:"admin-token"
        },
        msg:"成功"
    };
    console.log('tag')
})

router.post('/user/info',async (ctx)=>{

    ctx.body ={
        code:1,
        data:{          
            avatar:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2F4d5fcb86634e800d1e616a19f3a3ae19ff6b1c746f9a-mo8lOk_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638686397&t=8f0748c41ea84f021d596f6b20664072",
            name:"落花有意随流水",
            roles:['admin']
        },
        msg:"成功"
    }

})

router.post('/getList',async (ctx)=>{

    ctx.body ={
        code:200,
        data:[
            {name:"item",type:"2"},
            {name:"item",type:"2"},
            {name:"item",type:"2"},
            {name:"item",type:"2"},
            {name:"item",type:"2"},
            {name:"item",type:"2"},
            {name:"item",type:"2"}
        ],
        msg:"成功"
    }

})



router.post('/logout',async (ctx)=>{

    ctx.body ={
        code:200,
        data:[],
        msg:"成功"
    }

})

module.exports = router